text = text = input().split()
text_lst = []
new_text = {}
for i in text:
    m = i.lower()
    text_lst.append(m)
for i in text_lst:
    c = text_lst.count(i)
    new_text[i] = c
for key, value in new_text.items():
    print(key, value)
